package com.unionx.unionxuf.localdao;

import java.util.List;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.unionx.unionxuf.entity.CropDTD;
import com.unionx.unionxuf.entity.SDTD;
import com.unionx.unionxuf.entity.SettleDTD;
import com.unionx.unionxuf.entity.Settlestyle;
import com.unionx.unionxuf.entity.updateDTD;
@Repository
public interface SettlestyleMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Settlestyle record);
  
    int insert1(Settlestyle record);
    
    int insertSelective(Settlestyle record);

    Settlestyle selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Settlestyle record);

    int updateByPrimaryKey(Settlestyle record);
  
    int updateBylsh(Settlestyle record);
    @Select("select * from settlestyle1 where  cropid = #{0} and isno = #{1} and zhuangtai=#{2}")
    List<Settlestyle> selectBylsandCid(String cropid, String serialno,String zhuangtai);

	List<String> selectByCp(String cropid);

	List<Settlestyle> selectByDtd(CropDTD dtd);

	int deleteByS(Settlestyle s);

	List<String> selectByCps(SDTD ss);

	int updateCtype(Settlestyle s);


	Settlestyle selectby(updateDTD up);

	String selectByName(String fangshi);

	List<Settlestyle> selectst(String cropid);

	@Select("select id, settlement, subjectname, subjectcode, isend, settlementcode, settlement_end,amount,tips,cropid,isno,mingxi,zhuangtai,shenhezhuangtai from view_settlestyle1 where  cropid = #{0} and isno = #{1}")
    List<Settlestyle> getSS(String cropid, String serialno);

	int deletebycidandlsh(CropDTD c);
	
	@Select("select settlement, subjectname, subjectcode, isend, settlementcode, settlement_end,amount,tips,cropid,isno,mingxi,zhuangtai from settlestyle where settlement=#{1}")
	Settlestyle selectbys(String string);

	int updateCtype2(Settlestyle s);

	@Select("select * from settlestyle1 where  isno=#{0} and cropid=#{1}")
	List<Settlestyle> selectBylsh(String isno,String cropid);

	@Select("select settlement, amount from view_settlestyle1 where  cropid = #{0} and isno = #{1}")
	List<SettleDTD> getJiesuanbz(String cropid, String string);




	

}